import VueRouter from 'vue-router'

//创建并暴露一个路由器
export default new VueRouter({
	routes: [
		{
			path:'/center',
			component:() => import('@/pages/center/Center'),
			redirect: { name: "mainPage" },
			name:'createCentreMain',
			children:[ //通过children配置子级路由
			{
				path: 'mainPage', //此处一定不要写：/news
				name:'mainPage',
				component:() => import('@/pages/center/MainPage')
			},
				{
					path: 'commentControl', //此处一定不要写：/news
					name:'commentControl',
					component:() => import('@/pages/center/CommentControl')
				},
				{
					path: 'contentControl', //此处一定不要写：/news
					name:'contentControl',
					component:() => import('@/pages/center/ContentControl')
				},
				{
					path: 'MessageControl', //此处一定不要写：/news
					name:'messageControl',
					component:() => import('@/pages/center/MessageControl')
				},
			]
		},
		{
			path: '/',
			name: 'index',
			redirect: { name: "main" }
		},
		{
			path: '/main',
			name: 'main',
			component: () => import('@/pages/main')
		},
		{
			path: '/info',
			name: 'info',
			component: () => import('@/pages/info')
		},
		{
			path: '/article',
			name: 'article',
			component: () => import('@/pages/Article')
		},
		{
			path: '/homepage',
			name: 'homepage',
			component: () => import('@/pages/HomePage')
		}, 
		
	]
})